package cn.stylefeng.roses.kernel.sys.modular.user.mapper;

import cn.stylefeng.roses.kernel.db.mp.injector.CustomBaseMapper;
import cn.stylefeng.roses.kernel.sys.modular.user.entity.SysUserOrgData;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface SysUserOrgDataMapper extends CustomBaseMapper<SysUserOrgData> {
    @Select("SELECT STATION_CODE,USERIDS FROM B_STATION WHERE USERIDS IS NOT NULL")
    List<Map<String, Object>> stationlist();

    List<String> getEqplist(List<String> stationcode);

    @Select(" SELECT ORG_CODE FROM SYS_HR_ORGDATA WHERE ORG_ID IN ( SELECT ORG_ID FROM SYS_USER_ORGDATA WHERE USER_ID=#{userId})")
    List<Long> getOrgDataCodeList(Long userId);

    @Select(" SELECT TO_CHAR(ORG_CODE) FROM SYS_HR_ORGANIZATION WHERE ORG_ID IN ( SELECT ORG_ID FROM SYS_USER_ORG WHERE USER_ID=#{userId})")
    List<String> getOrgCodeList(Long userId);
}
